package com.hkbigdata.transfrom;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author liuanbo
 * @creat 2023-04-19-19:08
 * @see 2194550857@qq.com
 */
public class Flink07_TransFrom_Union {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        DataStreamSource<Integer> integerDataStreamSource = env
                .fromElements(10, 3, 5, 9, 20, 8);

        DataStreamSource<Integer> integerDataStreamSource1 = env
                .fromElements(10, 3, 5, 9, 8);

        DataStreamSource<Integer> integerDataStreamSource2 = env
                .fromElements(10, 3, 5, 9, 20, 80);

        DataStream<Integer> unionDS = integerDataStreamSource.union(integerDataStreamSource1).union(integerDataStreamSource2);

        unionDS.print();

        env.execute();




    }
}
